<?php
class Answer extends AppModel{
	
	public $name = 'Answer';
	
	public $useTable = 'answers';
	
	public $belongTo = array(
			'Question'=>array('className'=>'Question', 'foreignKey'=>'question_id')
	);
	
	public  $validate = array();
	
	public function AddAnswerValidate(){
		$validate1 = array(
				'question_id'=> array(
					'mustNotEmpty'=>array(
						'rule' => 'notEmpty', 
						'message'=> 'Please enter question')),
				'content' => array(
					'mustNotEmpty' => array(
						'rule' => 'notEmpty',
						'message'=> 'Please enter question content'))
			);
		$this->validate=$validate1;
		return $this->validates();
	}
}
?>